package com.example.kotlindemo.adapter

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.kotlindemo.category.*

class HomeTabsAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {

    private val fragments = listOf(
        RecommendedFragment(),
        HotFragment(),
        LifeFragment(),
        MallFragment(),
        LiveFragment(),
        FollowFragment(),
        OtherFragment()
        // 添加其他 Fragment 实例
    )

    override fun getItemCount(): Int = fragments.size

    override fun createFragment(position: Int): Fragment = fragments[position]
}